/*
 *         Copyright (c) KUBOTA Corporation and HUDSON SOFT,
 *                  1994, 1995 All Rights Reserved
 *
 *  This software comprises unpublished confidential information of
 *  KUBOTA Corp. and HUDSON SOFT. It may not be used, copied or made 
 *  available to anyone, except in accordance with the license under
 *  which it is furnished.
 */
static char SccsId[] = "@(#)aorotxsc.c	1.6	9/19/95";
#include <farl.h>
#include <agl.h>

/*
 * 引数で与えられたsin, cosでオブジェクトをＸ軸回転
 */
void
AGLRotateObjXSC(object *obj, fix1015 SinXX, fix1015 CosXX)
{
     fix187		sinx187, cosx187;

     if (SinXX == 0 && CosXX == 0x7fff) return;

     /* 現在のObjToWorld187マトリクスに、Ｘ軸回転を掛ける	*/
     sinx187 = CONV1015TO187(SinXX);
     cosx187 = CONV1015TO187(CosXX);
     if (obj->objChanged == -2) {
	  FarlGetRotateXSC4x4M187(sinx187, cosx187,
	  			(unsigned short*)obj->objToWorld187);
     } else {
	  FarlSetSrcMatrix((unsigned short*)obj->objToWorld187);
	 FarlRotateXSC4x4M187(sinx187, cosx187);
	 FarlCopyDstToMem4x4((unsigned short*)obj->objToWorld187);
    }

     /* 現在のObjToWorld1015マトリクスに、Ｘ軸回転を掛ける	*/
     if (obj->objChanged < 0) {
	  FarlGetRotateXSC3x3M1015(SinXX, CosXX,
	  			(unsigned short*)obj->objToWorld1015);
     } else {
	  FarlSetSrcMatrix3x3((unsigned short*)obj->objToWorld1015);
	 FarlRotateXSC3x3M1015(SinXX, CosXX);
	 FarlCopyDstToMem3x3((unsigned short*)obj->objToWorld1015);
    }
     obj->objChanged = 1;
}
